class Animal:
    # 类属性（所有实例共享）
    species = 'Canis familiaris'

    def __init__(self, name, brith):
        self.name = name
        self.brith = brith

    def speak(self):
        raise NotImplementedError('Subclasses must implement this method!')

    def info(self):
        raise NotImplementedError('Subclasses must implement this method!')

class Dog(Animal):
    def speak(self):
        print("woof!")

    def info(self):
        print(f'狗狗: {self.name}, 生日: {self.brith}')

class Cat(Animal):
    def speak(self):
        print("Meow!")

    def info(self):
        print(f'喵喵: {self.name}, 生日: {self.brith}')

# 使用多态
def animal_sound(animal):
    animal.speak()

def animal_info(animal):
    animal.info()

dog = Dog('candy', '2022-01-12')
cat = Cat('cater', '2020-03-23')

animal_info(dog)
animal_sound(dog)
animal_info(cat)
animal_sound(cat)